import { ajax } from "../utils/request";


//登录
export function login(data){
    return ajax({
        url:'/login',
        method:'POST',
        data
    })
}

//商品列表
export function proList(data){
    return ajax({
        url:'/goods',
        data
    })
}

//添加商品
export function addPro(data){
    return ajax({
        url:'/goods',
        method:'POST',
        data
    })
}

//商品删除请求
export function removeProList(data) {
    return ajax({
      url: "/goods/" + data.id,
      method: "delete",
      data,
    });
  }


//获取商品分类
export function proCategories(){
    return ajax({
        url:'/categories',

    })
}

//删除分类
export function delCategories(data){
    return ajax({
        url:'/categories/' + data.id,
        method:'delete',
        data
    })
}

//编辑分类
export function editCategories(data){
    return ajax({
        url:'/categories/' + data.id,
        method:'put',
        data
    })
}

//添加分类
export function addCategories(data){
    return ajax({
        url:'/categories',
        method:'post',
        data
    })
}